<?php
    namespace yaliSDK\common;
    class TestSingle {
        private static $_instance;

        private function __construct() {
            # code...
        }

        private function clone() {
            # empty
        }

        public static function GetInstance() {
            if (!(self::$_instance instanceof self)) {
                self::$_instance = new self();
            }
            return self::$_instance;
        }

        public function SayHi() {
            echo time();
        }
    }